<?php

    // uncomment the following to define a path alias
    // Yii::setPathOfAlias('local','path/to/local-folder');

    // This is the main Web application configuration. Any writable
    // CWebApplication properties can be configured here.
    return array(
        'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
        'name'=>'Yii Application',
        'sourceLanguage'=>'vi',
        'language'=>'vi', 
        'theme'=>'admin',
        'timezone'=>'Asia/Ho_Chi_Minh',

        // preloading 'log' component
        'preload'=>array('log'),

        // autoloading model and component classes
        'import'=>array(
            'application.models.*',
            'application.components.*',
            'ext.MyDateTime',
            'ext.Myext',
        ),

        'modules'=>array(
            'user' => array(
                'defaultController' => 'page',
            ),
            'hehe' => array(
                'defaultController' => 'page',
                'modules'=>array(
                    'web' => array(
                        'defaultController' => 'page',
                    ),
                ),
            ),
            'hangve' => array(
                'defaultController' => 'page',
            ),
            'sms'=>array (
                'class'=>'application.components.Sms',
            ),
            'gii'=>array(
                'class'=>'system.gii.GiiModule',
                'password'=>'123',
                // If removed, Gii defaults to localhost only. Edit carefully to taste.
                'ipFilters'=>array('127.0.0.16','::1','127.0.0.1'),
            ),
        ),

        'controllerMap'=>array(
            'min'=>array(
                'class'=>'ext.minScript.controllers.ExtMinScriptController',
                //'optionName'=>'optionValue',
            ),
        ),

        // application components
        'components'=>array(
            'sms'=>array (
                'class'=>'application.components.Sms',
            ),
            'cache' => array(
                'class' => 'CFileCache',
                'cachePath' => 'protected/runtime/cache/',
            ),
            'cacheData' => array(
                'class' => 'application.components.CacheData',
            ),
            'webData' =>  array(
                'class' => 'application.components.WebData',
            ),

            'crypt'=>array (
                'class'=>'ext.Crypt',
                'key'=>'CTA^*IhgHAIjHGF%^@',
            ),
            'clientScript'=>array(
                'class'=>'ext.minScript.components.ExtMinScript',
                //'optionName'=>'optionValue',
            ),

            'errorHandler'=>array(
                'errorAction'=>'/hangve/page/error',
            ),

            // uncomment the following to enable URLs in path-format
            'urlManager'=>array(
                'urlFormat'=>'path',
                'showScriptName'=>false,
                'rules'=>require(dirname(__FILE__).'/urlManager_rules.php'),
            ),
            'db'=>require(dirname(__FILE__).'/db.php'),
            'dbGeo'=>require(dirname(__FILE__).'/dbGeo.php'),
            'dbUser'=>require(dirname(__FILE__).'/dbUser.php'),
            'dbHehe'=>require(dirname(__FILE__).'/dbHehe.php'),
            'dbCta'=>require(dirname(__FILE__).'/dbCta.php'),
            'dbHangve'=>require(dirname(__FILE__).'/dbHangve.php'),


            'log'=>array(
                'class'=>'CLogRouter',
                'routes'=>array(
                    //                    array(
                    //                        'class'=>'ext.yii-debug-toolbar.YiiDebugToolbarRoute',
                    //                        'ipFilters'=>array('127.0.0.1','192.168.1.215'),
                    //                    ),
                    //                    array(
                    //                        'class'=>'CFileLogRoute',
                    //                        'levels'=>'error, warning',
                    //                    ),
                    //                    array(
                    //                        'class'=>'CWebLogRoute',
                    //                    ),
                ),
            ),


        ),

        // application-level parameters that can be accessed
        // using Yii::app()->params['paramName']
        'params'=>require(dirname(__FILE__).'/params.php'),
        'defaultController' => 'user',

        'onBeginRequest'=>create_function('$event', 'return ob_start("ob_gzhandler");'),
        'onEndRequest'=>create_function('$event', 'return @ob_end_flush();'),

    );